/**
 * @Auther: ayo
 * @Date: 2021/6/3 15:34
 * @Description: // TODO
 */
import { defineConfig } from 'umi';

export default defineConfig({
    define: {
        API_URL: 'https://api-test.xxx.com', // API地址
        API_SECRET_KEY: 'XXXXXXXXXXXXXXXX', // API调用密钥
    },
    plugins: [
        // https://github.com/zthxxx/react-dev-inspector
        'react-dev-inspector/plugins/umi/react-inspector',
    ],
    // https://github.com/zthxxx/react-dev-inspector#inspector-loader-props
    inspectorConfig: {
        exclude: [],
        babelPlugins: [],
        babelOptions: {},
    },
    webpack5: {
        // lazyCompilation: {},
    },
});

/**
 // src/services/user.ts
 import { request } from 'umi';

 export async function query() {
	// 使用API密钥调用用户接口
  return request<API.CurrentUser[]>('${API_URL}/api/users', {
		API_SECRET_KEY,
	});
}
 **/
